# Root Cornucopia CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

PROJECT( Cornucopia )

IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE Release CACHE STRING
      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
      FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

IF(MSVC)
   ADD_DEFINITIONS(/arch:SSE2 /fp:fast)
ELSE(MSVC)
   ADD_DEFINITIONS(-ffast-math)
ENDIF(MSVC)

#Find Eigen 3
SET(CMAKE_PREFIX_PATH ${Cornucopia_SOURCE_DIR}/../ ${CMAKE_PREFIX_PATH}) 
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${Cornucopia_SOURCE_DIR})
FIND_PACKAGE(Eigen3 REQUIRED)
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})

ADD_SUBDIRECTORY( Cornucopia )
ADD_SUBDIRECTORY( DemoUI )
ADD_SUBDIRECTORY( Tools )
ADD_SUBDIRECTORY( Test )

INCLUDE(InstallRequiredSystemLibraries)

SET(CPACK_PACKAGE_NAME, "Cornucopia")
SET(CPACK_PACKAGE_VENDOR "Ilya Baran")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/gpl.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_PACKAGE_EXECUTABLES "DemoUI" "Cornucopia DemoUI")
INCLUDE( CPack )
